In [1]:
import pandas
tss = pandas.read_csv("NSQD_Res_TSS.csv")
In [2]:
medians = (
tss.groupby(by=['parameter', 'units', 'season'])
.median()['res']
.reset_index()
)
medians
Out[2]:
In [3]:
index_cols = [
'epa_rain_zone', 'location_code', 'station_name', 'primary_landuse',
'start_date', 'season', 'station', 'parameter', 'units',
]
medians = (
tss.groupby(by=index_cols)
.first()
.reset_index()
.groupby(by=['parameter', 'units', 'season'])
.median()['res']
.reset_index()
)
medians
Out[3]: